package com.bibrApp.difu.utils;

import android.text.TextUtils;


public class RegUtils {
    /**
     * 正则匹配账户，隐藏中间字段
     * @param account
     * @return
     */
    public static String regAccount(String account){
        if(TextUtils.isEmpty(account)){
            return "";
        }
        return account.contains("@")?account.replaceAll("(\\w?)(\\w+)(\\w)(@\\w+\\.[a-z]+(\\.[a-z]+)?)", "$1****$3$4") :account.replaceAll("(\\d{3})\\d{4}(\\d{4})", "$1****$2");
    }
}
